package isnork.g2;

import isnork.sim.SeaLifePrototype;

import java.util.Comparator;

public class SeaLifeComparator implements Comparator<SeaLifePrototype> {
	
	public int compare(SeaLifePrototype o1, SeaLifePrototype o2) {
		if((o1.getHappiness()/(o1.getMaxCount()+o1.getMinCount()))>(o2.getHappiness()/(o2.getMaxCount()+o2.getMinCount())))
			return -1;
		if((o1.getHappiness()/(o1.getMaxCount()+o1.getMinCount()))<(o2.getHappiness()/(o2.getMaxCount()+o2.getMinCount())))
			return 1;
		return 0;
	}

}
